


jdn comments it all at you

by synecdochic



Series: mezzanine [29]
Category: Stargate SG-1
Genre: Epistolary, Imported, nerd jokes
Language: English
Status: Completed
Published: 2009-10-30
Updated: 2009-10-30
Packaged: 2018-05-31 20:08:06
Rating: Not Rated
Warnings: Creator Chose Not To Use Archive Warnings
Chapters: 1
Words: 1,651
Publisher: archiveofourown.org
Story URL: https://archiveofourown.org/works/6485731
Author URL: https://archiveofourown.org/users/synecdochic/pseuds/synecdochic
Summary: <blockquote class="userstuff">
              <p>A selection of jdn's greatest hits.</p>
            </blockquote>





	jdn comments it all at you

**Author's Note:**

> (Originally [posted](http://synecdochic.dreamwidth.org/353705.html) 2009-10-30.)
> 
> This started with a discussion on Dreamwidth's irc channel. We have a bot (Figment/Bit) that will answer YES or NO to questions, and if given two options, choose you one. If you ask the bot "Bit, $foo or code?" it will always tell you to code. Always.
> 
> This resulted in:
> 
>    
> 2:37:24 AM: rahaeli: bit, porn or code?  
> 2:37:26 AM: Figment: Wha...? Is this a trick question? code, of course.  
> 2:37:34 AM: rahaeli: DAMMIT SOPHIE YOU HAVE PROGRAMMED THAT BOT.  
> 2:37:41 AM: Afuna: hahahahahahahah  
> 2:37:46 AM: Afuna: oh figment, ilu  
> 2:38:10 AM: Azz|Eee: you could make jdn code?  
> 2:38:58 AM: rahaeli: ha ha ha ha ha you do not want to read jdn's code  
> 2:39:46 AM: Azz|Eee: I bet it is commented  
> 2:39:52 AM: niq: i do not see how jdn's code can possibly be more terrifying than the eldritch horrors that still lurk in the codebase (even allowing for a lot of monster-hunting that's been done!)  
> 2:39:52 AM: rahaeli: yes. it has one comment:  
> 2:39:59 AM: rahaeli: # if this code doesn't make sense to you, drink more beer.  
> 2:40:55 AM: niq: i thought there was at least one piece of code commented with  
> 2:40:59 AM: niq: # do not touch this. no, really, don't no matter how clever you think you are. it is magic.  
> 2:41:02 AM: rahaeli: oh yes  
> 2:41:30 AM: rahaeli: and there is at least one instance of a 1500-line subroutine written in impenetrable line noise artfully arranged into ascii art  
> 2:41:56 AM: niq: jdn wants to make sure that reading his code is *entertaining* for those who come after him  
> 2:42:08 AM: rahaeli: and his absolute favorite, the four-line routine that nobody has ever been able to figure out (except mitchell) with a comment preceding it:  
> 2:42:15 AM: rahaeli: # i shall now produce some job security:  
> 2:42:22 AM: niq: because it so rarely is entertaining for him when digging into other people's code!  
> 2:43:06 AM: Azz|Eee: there also may be things like #at this juncture I decided it was, yet again, beer time.  
> 2:44:19 AM: rahaeli: oh god now i'm tempted to write the best of jdn's comments
> 
> So I did.
    
    
    # and because this is perl, i shall now let the cat walk over the keyboard:
    
    [15 lines of line noise]
    
    # we don't have a cat, by the way.
    
    
    
    * * *
    
    
    
    /* if you received a copy of this source code without the accompanying
     * hundred-page binder containing its documentation, in which we explain
     * what a horrible idea it would be, you will now be tempted to refactor
     * the subsequent code into something that makes more sense to you, or 
     * which more closely fits your K&R. verb. sap. sat. -- don't. also, if 
     * you received a copy of this source without the documentation, go 
     * yell at whomever's violating our intellectual property for me, eh?
     */
    
    
    
    * * *
    
    
    
    /* if you ignored the preceding comment and tried to refactor that code
     * anyway, once you are finished and have realized that yes, i did have 
     * a very good reason for doing it my way, please increment this as a
     * warning for the next idiot who doesn't listen to my very sensible advice:
     * 
     * total time lost trying to prove i am smarter than jdn: 0 hours
     *
     */

(He and Cammie got called back four years later to do an upgrade of the system. The counter was at 17 hours, with an additional comment after it: "guys, he really means it. --pch".)
    
    
    * * *
    
    
    
    /* if you got here, you were probably trying to do something that 
     * violates the laws of physics again. don't.
     */
    
    
    
    * * *
    
    
    
    # i'm a little teapot, short and stout. here is my handle; here is my count.
    
    
    
    * * *
    
    
    
    /* right about here is where i insert my rant about how c makes it not only
     * easy to shoot yourself in the foot, it helpfully takes off the safety
     * and points the sidearm for you. if you need a copy of that rant, it
     * is available on request.
     */
    
    
    
    * * *
    
    
    
    /* and this is why you don't want to let me write your error messages. */
    
    
    
    * * *
    
    
    
    =begin
     if i'd been allowed to write this in c++, the following subroutine 
     would've been four lines long. but noooooo, we had to use ruby. why
     did we have to use ruby? do i look like i make the decisions around
     here? if i did, this wouldn't be a web app. (i did explicitly reserve 
     the right to say 'i told you so' in our contract.)
    =end
    
    
    
    * * *
    
    
    
    # if you are maintaining this after we have handed it over, about all 
    # i have to say is that i'm very, very sorry, and i will never do it 
    # again. in my defense, it /does/ work.
    
    
    
    * * *
    
    
    

(Over several revisions of the same file:)

r242:  
`# dear mitchell: fixed this for you.`

r243:  
`# Dear Nielson: I fixed it back.`

r244:  
`# dear mitchell: i was right the first time.`

r245:  
`# Dear Nielson: please see http://bugs.nielsonmitchell.com/show_bug.cgi?id=15924`  
`# I will accept apologies in the form of chocolate, candy, alcohol, and/or yarn.`

r246, in which nothing changed but the comment:  
`# dear mitchell: bite me.`
    
    
    * * *
    
    
    
    /* i tried ripping this out, but the guy before me was smart enough to
     * put in the same kind of job security i put in up there. it didn't
     * seem to work for him too well, since i got the job of maintaining
     * his code, but at least his idiot code lives on.
     */
    
    
    
    * * *
    
    
    
    /* the traveling salesman is in! advice $.05, NP-incompleteness free 
     * (and i won't even yank out the football)
     */
    
    
    
    * * *
    
    
    
    # i'm an idiot for this, you know it, i know it, i'm so very sorry, and
    # if you're ever in colorado springs, i'll buy you a beer to apologize.
    
    
    
    * * *
    
    
    
    /* if you remove this comment, the compiler will crash */

`[ 20 lines of code or so ]`
    
    
    /* i bet you tried removing that comment up there, didn't you? at least 
     * once. i know i would've. still: i told you so. 
     */
    
    
    
    * * *
    
    
    
    # i've heard of projects that dealt only with file formats that were built 
    # on accurate, open, reliable standards and never had to resort to horrible 
    # hacks like this. this is not one of those projects.
    
    
    
    * * *
    
    
    
    /* if you fuck with this function, there shall be a great earthquake,
     * and the sun shall become black as sackcloth of hair, and the moon become
     * as blood, and the stars of heaven fall unto the earth even as a fig
     * tree casteth her untimely figs when she is shaken of a mighty wind, and
     * the heaven depart as a scroll when it is rolled together, and every
     * mountain and island be moved out of their places, so don't do that, okay?
     */ 
    
    
    
    * * *
    
    
    
    # mitchell made me do it.
    
    
    
    * * *
    
    
    
    # ia! ia! cthulhu fthagn!
    
    
    
    * * *
    
    
    
    /* look, i KNOW this is wrong, comments in previous revisions TOLD you 
     * i know this is wrong, but it's there to work around the bug in the 
     * firmware that i spent SIX WEEKS trying to chase down and if you 
     * take it out it will crash when memory usage goes up over 64k. if
     * you keep taking it out, YOU get to figure out how to fit the whole
     * shebang into that tiny a footprint, so STOP DICKING WITH MY CODE.
     */
    
    
    
    * * *
    
    
    
    # 4/13/11: FIXME, this is temporary 
    # 1/19/15: ...or not, since it looks fine to me now 
    # 9/4/17: oh, so *that's* what i meant.
    
    
    
    * * *
    
    
    
    /* the following css definition can be safely removed when your office
     * upgrades from IE6 to something else. given past behavior,
     * i expect this to be sometime in 2025 or so.
     */
    
    
    
    * * *
    
    
    
    # well, *i* thought this was self-explanatory, but since we got 
    # called back six months later because you all got stuck every time
    # you tried to change it, i guess i was wrong. let me try again:
    
    
    
    * * *
    
    
    
    # very very useful debugging function. yes, i know it's not called
    # by anything else right now, but i've included it as a gift from
    # us to whomever gets stuck maintaining this in the future. trust me,
    # if you want to play with any of this later, you'll need it. 
    
    
    
    * * *

(before a function that specified what to do with a dataset containing wrong/bad/invalid dates:)
    
    
    /* it's just a jump to the left
     * and then a step to the riiiiiiiiight
     * put your hands on your tits (or someone else's!)
     * and pull your knees in tiiiiiight
     * but it's the pelvic thrust
     * that really drives you insaaaaaaane
     * let's do the time warp again!
     * or, okay, we could just sanitize the data set.
     */
    
    
    
    * * *
    
    
    
    # yes, this will be on the exam.
    
    
    
    * * *
    
    
    
    # the only thing i hate more than i hate perl? regular expressions.
    
    
    
    * * *
    
    
    
    /* i am putting this comment here so that i have something i can easily
     * grep for: ARGLE BARGLE BLOOFLY SPLORGE.
     */
    
    
    
    * * *
    
    
    
    # this will NOT be an option. every time you try to make it an option,
    # i will come back behind you and make it a constant instead. i do not
    # CARE what the users want; i care what is correct behavior.
    
    
    
    * * *
    
    
    
    # for a change, i'll write it in haiku:
    # every time you try
    # optimizing this function
    # god kills a kitten
    
    
    
    * * *
    
    
    
    /* ooooh, look who won the commit-and-ditch pony this round! */
    
    
    
    * * *
    
    
    
    /* you know that old saw about coding as though the person who's going
     * to maintain your code is a violent sociopath who knows where you 
     * live? in this case, i live with her.
     */
    
    
    
    * * *
    
    
    
    # i was a sane man before we took this contract, really i was
    #
    # (Best laugh I've had all day -- cem)
    
    
    
    * * *
    
    
    
    # one function to bring them all and in the darkness bind them:
    
    
    
    * * *
    
    
    
    /* before you change any of this code, go read RFC 4251. then throw 
     * it out, because the people who wrote the code that this interfaces
     * with sure did. alternately, you can hunt them down and tattoo
     * it on the backs of their eyeballs, which is what i plan on doing
     * as soon as i finish coding around their fuckups.
     */
    
    
    
    * * *
    
    
    
    /* if the bank ever gets off their asses and fixes their transmission
     * protocols, this function can safely be removed. (i wouldn't try
     * it until then, though, unless you like corrupting an entire 
     * night's run and waking some poor dba up at 0400.)
     */
    
    
    
    * * *
    
    
    
    # uncomment the following 15 lines if the client changes his mind
    # AGAIN on the next call (i got tired of looking it up in svn:)
    
    
    
    * * *
    
    
    
    /* good evening. you are looking at this code because the unit tests
     * are failing, aren't you? yes, i can read your mind. i have good news
     * and bad news for you. the bad news is, the problem is not here. the
     * good news is, if you recently made any changes to anything between
     * the lines marked 'here be dragons' in client.c, that's where the 
     * problem likely is; go revert those changes and try again, and then
     * think very carefully about what you were trying to do. the other 
     * bad news is that if you haven't made any recent changes to client.c, 
     * my mindreading ability is on the fritz again and you're trying to use
     * this function for something it shouldn't oughta be used for.
     */
    
    
    
    
    * * *
    
    
    
    # so, guess what: the vendor doesn't document their drivers, which means
    # that this value is entirely trial and error. i applied to the great
    # god google, and found nothing but fifty pages of people asking the 
    # same question. fifty hours of trial and error with the unit tests
    # give us a result of 1.67, but if the vendor updates its drivers,
    # god knows if it will change. if this happens, we have thoughtfully
    # included the 'vendorsaremorons.pm' module we used to discover the 
    # value in the first place, which i will now go post somewhere for the
    # great god google to pick up and cause millions to praise my name.
    
    
    
    * * *
    
    
    
    /* at this point i would cordially like to invite adobe to BITE ME. */
    
    
    
    
    * * *
    
    
    
    /* we don't need this algorithm anymore, but by god it took me years to
     * come up with an O(log n!) implementation of it, so surprise! merry
     * christmas, use it later and think of me.
     */
    
    
    
    * * *
    
    
    
    # in this case, i will reluctantly admit that mitchell is smarter than i am.
    #
    # (I'm going to print that out and put it on my wall -- cem)
    
    
    
    * * *
    
    
    
    # and on the seventh day, i rested.
    


End file.
